package com.netease.b.a;

import android.text.TextUtils;
import com.netease.framework.a.k;
import com.netease.framework.a.m;
import com.netease.pris.a.r;
import com.netease.pris.atom.ad;
import com.netease.pris.atom.q;
import com.netease.pris.atom.u;
import java.io.File;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

public class z extends ag
  implements com.netease.framework.b.d
{
  static final String a = "PRISTransactionConverImg";
  int b;
  String c;
  String d;
  m e;
  LinkedList f;
  com.netease.pris.protocol.d g;

  protected z(String paramString1, String paramString2, int paramInt)
  {
    super(paramInt);
    this.c = paramString1;
    this.d = paramString2;
  }

  public static z a(String paramString1, String paramString2)
  {
    return new z(paramString1, paramString2, 1400);
  }

  private String a(String paramString)
  {
    File localFile1;
    if (!TextUtils.isEmpty(paramString))
    {
      String str2 = r.a(paramString);
      localFile1 = new File(com.netease.pris.c.a.a() + str2);
      String str3 = com.netease.a.a.e.a(str2, false);
      if (str3 != null)
      {
        File localFile2 = new File(str3);
        com.netease.a.a.e.b(localFile2);
        localFile2.renameTo(localFile1);
      }
    }
    for (String str1 = localFile1.getPath(); ; str1 = null)
      return str1;
  }

  public static z b(String paramString1, String paramString2)
  {
    return new z(paramString1, paramString2, 1401);
  }

  private boolean b()
  {
    int i;
    if (this.f != null)
      if (!com.netease.pris.a.e.a())
        i = 0;
    while (true)
    {
      return i;
      while (true)
        if (this.f.size() > 0)
        {
          String str = (String)this.f.removeFirst();
          if (new File(com.netease.pris.c.a.a() + r.a(str)).exists())
            continue;
          g localg = g.a(str, true, false, false);
          localg.b(0);
          localg.a(this);
          com.netease.image.d.a().d().a(localg);
          i = 1;
          break;
        }
      a();
      i = 0;
    }
  }

  private void c(com.netease.pris.protocol.d paramd)
  {
    if ((paramd == null) || (paramd.g == null));
    while (true)
    {
      return;
      q localq1 = paramd.g.a();
      if ((localq1 == null) || (localq1.a() == null))
        continue;
      this.g = paramd;
      String str1 = com.netease.pris.b.a.q();
      int i = 1;
      if (!TextUtils.isEmpty(str1))
      {
        q localq2 = new q();
        localq2.g(str1);
        if ((localq2.a() != null) && (localq2.a().compareTo(localq1.a()) >= 0))
          i = 0;
      }
      if (i == 0)
        continue;
      this.f = new LinkedList();
      Iterator localIterator = paramd.h.iterator();
      while (localIterator.hasNext())
      {
        u localu = (u)localIterator.next();
        if (n() == 1400)
        {
          String str4 = localu.b(com.netease.pris.atom.g.f);
          if (TextUtils.isEmpty(str4))
            continue;
          this.f.add(str4);
          continue;
        }
        String str2 = localu.b(com.netease.pris.atom.g.K);
        if (!TextUtils.isEmpty(str2))
          this.f.add(str2);
        String str3 = localu.b(com.netease.pris.atom.g.L);
        if (TextUtils.isEmpty(str3))
          continue;
        this.f.add(str3);
      }
    }
  }

  void a()
  {
    com.netease.pris.c.a.b(d.h().a());
    LinkedList localLinkedList1 = new LinkedList();
    int i = 0;
    if (i < this.g.h.size())
    {
      u localu2 = (u)this.g.h.get(i);
      com.netease.pris.atom.b.a locala = new com.netease.pris.atom.b.a();
      locala.a(localu2.V());
      locala.f(localu2.aB());
      locala.d(localu2.U());
      locala.e(localu2.X());
      locala.a(localu2.aH());
      if (n() == 1400)
      {
        String str4 = localu2.b(com.netease.pris.atom.g.f);
        if (!TextUtils.isEmpty(str4))
          locala.c(com.netease.pris.c.a.a() + r.a(str4));
      }
      while (true)
      {
        localLinkedList1.add(locala);
        i++;
        break;
        String str2 = localu2.b(com.netease.pris.atom.g.K);
        if (!TextUtils.isEmpty(str2))
          locala.c(com.netease.pris.c.a.a() + r.a(str2));
        String str3 = localu2.b(com.netease.pris.atom.g.L);
        if (TextUtils.isEmpty(str3))
          continue;
        locala.b(com.netease.pris.c.a.a() + r.a(str3));
      }
    }
    com.netease.pris.c.a.b(d.h().a());
    String str1 = this.g.g.a().b();
    com.netease.pris.b.a.j(str1);
    com.netease.pris.c.a.a(d.h().a(), str1, this.g.h, localLinkedList1);
    LinkedList localLinkedList2 = new LinkedList();
    Iterator localIterator = this.g.h.iterator();
    while (localIterator.hasNext())
    {
      u localu1 = (u)localIterator.next();
      if (n() == 1400)
      {
        localLinkedList2.add(a(localu1.b(com.netease.pris.atom.g.f)));
        continue;
      }
      localLinkedList2.add(a(localu1.b(com.netease.pris.atom.g.K)));
      localLinkedList2.add(a(localu1.b(com.netease.pris.atom.g.L)));
    }
    com.netease.pris.c.a.a(localLinkedList2);
  }

  public void a(int paramInt1, int paramInt2, int paramInt3, Object paramObject)
  {
    if (!b())
      c(0, new com.netease.pris.protocol.d());
  }

  protected void a(int paramInt, Object paramObject)
  {
    if ((paramObject != null) && ((paramObject instanceof com.netease.pris.protocol.d)))
    {
      com.netease.pris.protocol.d locald = (com.netease.pris.protocol.d)paramObject;
      c(locald);
      if (!b())
        c(0, locald);
    }
    while (true)
    {
      return;
      super.a(paramInt, paramObject);
    }
  }

  public void b(int paramInt1, int paramInt2, int paramInt3, Object paramObject)
  {
    d(paramInt1, paramObject);
  }

  public void c()
  {
    if (!com.netease.pris.b.a.S())
      d.h().a(this);
    while (true)
    {
      return;
      switch (n())
      {
      default:
      case 1400:
      case 1401:
      }
      for (k localk = null; ; localk = com.netease.pris.protocol.c.f(this.c, this.d))
      {
        if (localk != null)
          break label74;
        d(0, null);
        h();
        break;
      }
      label74: this.e = localk;
      a(this.e);
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.b.a.z
 * JD-Core Version:    0.6.0
 */